/*
 * Copyright (c) 2019-2020 Arm Limited.
 *
 * SPDX-License-Identifier: MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */
#ifdef __aarch64__

#include "arm_gemm.hpp"
#include "../../utils.hpp"

#include <cassert>

namespace arm_gemm {

void a64_hybrid_fp32_mla_8x4 (
    unsigned int num_strings, const unsigned int *string_lengths, IndirectInputArg<float> A_arg,
    size_t M, size_t N, const float *B_ptr, IndirectOutputArg<float> output_arg,
    const float *bias, Activation act, bool accumulate
)
{
    struct KernelArgs {
        float maxval = static_cast<float>(std::numeric_limits<float>::infinity());
        float minval = - static_cast<float>(std::numeric_limits<float>::infinity());
        unsigned int num_strings = {};
        const unsigned int *string_lengths = {};
        size_t N = {};
        const float *B_ptr = {};
        size_t output_offset = {};
        size_t input_initial_col = {};
        size_t input_offset = {};
    } ka;

    unsigned long flags=0;
    void *output_ptr;
    void *input_ptr;

    if (output_arg.is_indirect) {
        output_ptr=(void *)(output_arg.indirect.ptr);
        ka.output_offset=output_arg.indirect.offset;
        flags |= 0x4;
    } else {
        output_ptr=(void *)(output_arg.direct.base);
        ka.output_offset=output_arg.direct.stride;
    }

    if (A_arg.is_indirect) {
        input_ptr=(void *)(A_arg.indirect.ptr);
        ka.input_offset=A_arg.indirect.start_row;
        ka.input_initial_col=A_arg.indirect.start_col;
        flags |= 0x8;
    } else {
        assert(num_strings==1);
        input_ptr=(void *)(A_arg.direct.base);
        ka.input_offset=A_arg.direct.stride;
    }
    if (accumulate) {
        flags |= 0x1;
    }
    ka.num_strings = num_strings;
    ka.string_lengths = string_lengths;
    ka.N = N;
    ka.B_ptr = B_ptr;
    switch(act.type) {
        default:
        case Activation::Type::None:
            break;
        case Activation::Type::BoundedReLU:
            ka.maxval = static_cast<float>(act.param1);
            /* fall through */
        case Activation::Type::ReLU:
            ka.minval = 0;
            flags |= 0x2;
            break;
    }
    __asm__ __volatile__(

      "1:"  // Row loop
      "cmp %x[M], #0x8\n"
      "bge 155f\n"
      "cmp %x[M], #0x6\n"
      "bgt 133f\n"
      "beq 111f\n"
      "cmp %x[M], #0x4\n"
      "bgt 89f\n"
      "beq 67f\n"
      "cmp %x[M], #0x2\n"
      "bgt 45f\n"
      "beq 23f\n"
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "mov x8, %x[bias]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 2f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "b 3f\n"
      "2:"  // Height 1: setup direct output
      "mov x17, %x[output_ptr]\n"
      "3:"  // Height 1: Column loop
      "cbz x8, 4f\n"
      "ldr q24, [x8, #0x0]\n"
      "add x8, x8, #0x10\n"
      "b 9f\n"
      "4:"  // Height 1: no bias
      "tbz %x[flags], #0, 8f\n"
      "cmp x6, #0x4\n"
      "bge 7f\n"
      "tbz x6, #1, 5f\n"
      "ldr d24, [x17], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 6f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "b 6f\n"
      "5:"  // Height 1: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "6:"  // Height 1: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "b 9f\n"
      "7:"  // Height 1: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "b 9f\n"
      "8:"  // Height 1: no accumulate
      "movi v24.16b, #0x0\n"
      "9:"  // Height 1: setup done
      "mov x16, #0x0\n"
      "10:"  // Height 1: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 11f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "cbnz x16, 12f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "b 12f\n"
      "11:"  // Height 1: setup direct input
      "mov x14, %x[input_ptr]\n"
      "12:"  // Height 1: input setup done
      "cmp x15, #0x4\n"
      "blt 15f\n"
      "cmp x15, #0x8\n"
      "blt 14f\n"
      "13:"  // Height 1: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "ldr q11, [x7, #0x30]\n"
      "add x14, x14, #0x10\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "cmp x15, #0x8\n"
      "add x7, x7, #0x40\n"
      "bge 13b\n"
      "14:"  // Height 1: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "ldr q15, [x7, #0x30]\n"
      "add x14, x14, #0x10\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "15:"  // Height 1: Multiply loop: Main loop skip
      "cbz x15, 17f\n"
      "16:"  // Height 1: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "add x7, x7, #0x10\n"
      "cbnz x15, 16b\n"
      "17:"  // Height 1: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 10b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "tbz %x[flags], #1, 18f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "18:"  // Height 1: No activation
      "cmp x6, #0x4\n"
      "bge 21f\n"
      "tbz x6, #1, 19f\n"
      "str d24, [x17], #0x8\n"
      "tbz x6, #0, 20f\n"
      "st1 { v24.s }[2], [x17]\n"
      "b 20f\n"
      "19:"  // Height 1: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "20:"  // Height 1: Partial direct writeback: Done
      "b 22f\n"
      "21:"  // Height 1: Full writeback
      "str q24, [x17, #0x0]\n"
      "add x17, x17, #0x10\n"
      "22:"  // Height 1: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 3b\n"
      "b 178f\n"
      "23:"  // Height 2
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 24f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "add x13, x13, x19, LSL #2\n"
      "b 25f\n"
      "24:"  // Height 2: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "25:"  // Height 2: Column loop
      "cbz x8, 26f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "b 31f\n"
      "26:"  // Height 2: no bias
      "tbz %x[flags], #0, 30f\n"
      "cmp x6, #0x4\n"
      "bge 29f\n"
      "tbz x6, #1, 27f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 28f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "b 28f\n"
      "27:"  // Height 2: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "28:"  // Height 2: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "b 31f\n"
      "29:"  // Height 2: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "b 31f\n"
      "30:"  // Height 2: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "31:"  // Height 2: setup done
      "mov x16, #0x0\n"
      "32:"  // Height 2: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 33f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "cbnz x16, 34f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "b 34f\n"
      "33:"  // Height 2: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "34:"  // Height 2: input setup done
      "cmp x15, #0x4\n"
      "blt 37f\n"
      "cmp x15, #0x8\n"
      "blt 36f\n"
      "35:"  // Height 2: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "ldr q11, [x7, #0x30]\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "add x12, x12, #0x10\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "cmp x15, #0x8\n"
      "add x7, x7, #0x40\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "bge 35b\n"
      "36:"  // Height 2: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "ldr q15, [x7, #0x30]\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "add x12, x12, #0x10\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "37:"  // Height 2: Multiply loop: Main loop skip
      "cbz x15, 39f\n"
      "38:"  // Height 2: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "cbnz x15, 38b\n"
      "39:"  // Height 2: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 32b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "tbz %x[flags], #1, 40f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "40:"  // Height 2: No activation
      "cmp x6, #0x4\n"
      "bge 43f\n"
      "tbz x6, #1, 41f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "tbz x6, #0, 42f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "b 42f\n"
      "41:"  // Height 2: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "42:"  // Height 2: Partial direct writeback: Done
      "b 44f\n"
      "43:"  // Height 2: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "44:"  // Height 2: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 25b\n"
      "b 178f\n"
      "45:"  // Height 3
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 46f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "ldr x11, [%x[output_ptr], #0x10]\n"
      "add x13, x13, x19, LSL #2\n"
      "add x11, x11, x19, LSL #2\n"
      "b 47f\n"
      "46:"  // Height 3: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "add x11, x13, x19, LSL #2\n"
      "47:"  // Height 3: Column loop
      "cbz x8, 48f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "mov v26.16b, v24.16b\n"
      "b 53f\n"
      "48:"  // Height 3: no bias
      "tbz %x[flags], #0, 52f\n"
      "cmp x6, #0x4\n"
      "bge 51f\n"
      "tbz x6, #1, 49f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "ldr d26, [x11], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 50f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "ld1 { v26.s }[2], [x11]\n"
      "b 50f\n"
      "49:"  // Height 3: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "ldr s26, [x11, #0x0]\n"
      "50:"  // Height 3: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "sub x11, x11, x19\n"
      "b 53f\n"
      "51:"  // Height 3: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "ldr q26, [x11, #0x0]\n"
      "b 53f\n"
      "52:"  // Height 3: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "movi v26.16b, #0x0\n"
      "53:"  // Height 3: setup done
      "mov x16, #0x0\n"
      "54:"  // Height 3: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 55f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "ldr x10, [x20, #0x10]\n"
      "cbnz x16, 56f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "add x10, x10, x19, LSL #2\n"
      "b 56f\n"
      "55:"  // Height 3: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "add x10, x12, x19, LSL #2\n"
      "56:"  // Height 3: input setup done
      "cmp x15, #0x4\n"
      "blt 59f\n"
      "cmp x15, #0x8\n"
      "blt 58f\n"
      "57:"  // Height 3: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v26.4s, v8.4s, v2.s[0]\n"
      "ldr q11, [x7, #0x30]\n"
      "add x14, x14, #0x10\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "add x12, x12, #0x10\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v26.4s, v9.4s, v2.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "cmp x15, #0x8\n"
      "add x7, x7, #0x40\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "fmla v26.4s, v10.4s, v2.s[2]\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "fmla v26.4s, v11.4s, v2.s[3]\n"
      "bge 57b\n"
      "58:"  // Height 3: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v26.4s, v12.4s, v2.s[0]\n"
      "ldr q15, [x7, #0x30]\n"
      "add x14, x14, #0x10\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "add x12, x12, #0x10\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v26.4s, v13.4s, v2.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v26.4s, v14.4s, v2.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "fmla v26.4s, v15.4s, v2.s[3]\n"
      "59:"  // Height 3: Multiply loop: Main loop skip
      "cbz x15, 61f\n"
      "60:"  // Height 3: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr s2, [x10], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "fmla v26.4s, v16.4s, v2.s[0]\n"
      "cbnz x15, 60b\n"
      "61:"  // Height 3: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 54b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "prfm pstl1keep, [x11, #0x0]\n"
      "tbz %x[flags], #1, 62f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmin v26.4s, v26.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "fmax v26.4s, v26.4s, v17.4s\n"
      "62:"  // Height 3: No activation
      "cmp x6, #0x4\n"
      "bge 65f\n"
      "tbz x6, #1, 63f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "str d26, [x11], #0x8\n"
      "tbz x6, #0, 64f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "st1 { v26.s }[2], [x11]\n"
      "b 64f\n"
      "63:"  // Height 3: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "str s26, [x11, #0x0]\n"
      "64:"  // Height 3: Partial direct writeback: Done
      "b 66f\n"
      "65:"  // Height 3: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "str q26, [x11, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "add x11, x11, #0x10\n"
      "66:"  // Height 3: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 47b\n"
      "b 178f\n"
      "67:"  // Height 4
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 68f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "ldr x11, [%x[output_ptr], #0x10]\n"
      "add x13, x13, x19, LSL #2\n"
      "ldr x9, [%x[output_ptr], #0x18]\n"
      "add x11, x11, x19, LSL #2\n"
      "add x9, x9, x19, LSL #2\n"
      "b 69f\n"
      "68:"  // Height 4: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "add x11, x13, x19, LSL #2\n"
      "add x9, x11, x19, LSL #2\n"
      "69:"  // Height 4: Column loop
      "cbz x8, 70f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "mov v26.16b, v24.16b\n"
      "mov v27.16b, v24.16b\n"
      "b 75f\n"
      "70:"  // Height 4: no bias
      "tbz %x[flags], #0, 74f\n"
      "cmp x6, #0x4\n"
      "bge 73f\n"
      "tbz x6, #1, 71f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "ldr d26, [x11], #0x8\n"
      "ldr d27, [x9], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 72f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "ld1 { v26.s }[2], [x11]\n"
      "ld1 { v27.s }[2], [x9]\n"
      "b 72f\n"
      "71:"  // Height 4: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "ldr s26, [x11, #0x0]\n"
      "ldr s27, [x9, #0x0]\n"
      "72:"  // Height 4: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "sub x11, x11, x19\n"
      "sub x9, x9, x19\n"
      "b 75f\n"
      "73:"  // Height 4: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "ldr q26, [x11, #0x0]\n"
      "ldr q27, [x9, #0x0]\n"
      "b 75f\n"
      "74:"  // Height 4: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "movi v26.16b, #0x0\n"
      "movi v27.16b, #0x0\n"
      "75:"  // Height 4: setup done
      "mov x16, #0x0\n"
      "76:"  // Height 4: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 77f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "ldr x10, [x20, #0x10]\n"
      "ldr x28, [x20, #0x18]\n"
      "cbnz x16, 78f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "add x10, x10, x19, LSL #2\n"
      "add x28, x28, x19, LSL #2\n"
      "b 78f\n"
      "77:"  // Height 4: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "add x10, x12, x19, LSL #2\n"
      "add x28, x10, x19, LSL #2\n"
      "78:"  // Height 4: input setup done
      "cmp x15, #0x4\n"
      "blt 81f\n"
      "cmp x15, #0x8\n"
      "blt 80f\n"
      "79:"  // Height 4: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v26.4s, v8.4s, v2.s[0]\n"
      "ldr q11, [x7, #0x30]\n"
      "fmla v27.4s, v8.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "add x12, x12, #0x10\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "add x10, x10, #0x10\n"
      "fmla v26.4s, v9.4s, v2.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v27.4s, v9.4s, v3.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "cmp x15, #0x8\n"
      "add x7, x7, #0x40\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "fmla v26.4s, v10.4s, v2.s[2]\n"
      "fmla v27.4s, v10.4s, v3.s[2]\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "fmla v26.4s, v11.4s, v2.s[3]\n"
      "fmla v27.4s, v11.4s, v3.s[3]\n"
      "bge 79b\n"
      "80:"  // Height 4: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v26.4s, v12.4s, v2.s[0]\n"
      "ldr q15, [x7, #0x30]\n"
      "fmla v27.4s, v12.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "add x12, x12, #0x10\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "add x10, x10, #0x10\n"
      "fmla v26.4s, v13.4s, v2.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v27.4s, v13.4s, v3.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v26.4s, v14.4s, v2.s[2]\n"
      "fmla v27.4s, v14.4s, v3.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "fmla v26.4s, v15.4s, v2.s[3]\n"
      "fmla v27.4s, v15.4s, v3.s[3]\n"
      "81:"  // Height 4: Multiply loop: Main loop skip
      "cbz x15, 83f\n"
      "82:"  // Height 4: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr s2, [x10], #0x4\n"
      "ldr s3, [x28], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "fmla v26.4s, v16.4s, v2.s[0]\n"
      "fmla v27.4s, v16.4s, v3.s[0]\n"
      "cbnz x15, 82b\n"
      "83:"  // Height 4: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 76b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "prfm pstl1keep, [x11, #0x0]\n"
      "prfm pstl1keep, [x9, #0x0]\n"
      "tbz %x[flags], #1, 84f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmin v26.4s, v26.4s, v16.4s\n"
      "fmin v27.4s, v27.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "fmax v26.4s, v26.4s, v17.4s\n"
      "fmax v27.4s, v27.4s, v17.4s\n"
      "84:"  // Height 4: No activation
      "cmp x6, #0x4\n"
      "bge 87f\n"
      "tbz x6, #1, 85f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "str d26, [x11], #0x8\n"
      "str d27, [x9], #0x8\n"
      "tbz x6, #0, 86f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "st1 { v26.s }[2], [x11]\n"
      "st1 { v27.s }[2], [x9]\n"
      "b 86f\n"
      "85:"  // Height 4: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "str s26, [x11, #0x0]\n"
      "str s27, [x9, #0x0]\n"
      "86:"  // Height 4: Partial direct writeback: Done
      "b 88f\n"
      "87:"  // Height 4: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "str q26, [x11, #0x0]\n"
      "str q27, [x9, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "add x11, x11, #0x10\n"
      "add x9, x9, #0x10\n"
      "88:"  // Height 4: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 69b\n"
      "b 178f\n"
      "89:"  // Height 5
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 90f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "ldr x11, [%x[output_ptr], #0x10]\n"
      "add x13, x13, x19, LSL #2\n"
      "ldr x9, [%x[output_ptr], #0x18]\n"
      "ldr x27, [%x[output_ptr], #0x20]\n"
      "add x11, x11, x19, LSL #2\n"
      "add x9, x9, x19, LSL #2\n"
      "add x27, x27, x19, LSL #2\n"
      "b 91f\n"
      "90:"  // Height 5: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "add x11, x13, x19, LSL #2\n"
      "add x9, x11, x19, LSL #2\n"
      "add x27, x9, x19, LSL #2\n"
      "91:"  // Height 5: Column loop
      "cbz x8, 92f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "mov v26.16b, v24.16b\n"
      "mov v27.16b, v24.16b\n"
      "mov v28.16b, v24.16b\n"
      "b 97f\n"
      "92:"  // Height 5: no bias
      "tbz %x[flags], #0, 96f\n"
      "cmp x6, #0x4\n"
      "bge 95f\n"
      "tbz x6, #1, 93f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "ldr d26, [x11], #0x8\n"
      "ldr d27, [x9], #0x8\n"
      "ldr d28, [x27], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 94f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "ld1 { v26.s }[2], [x11]\n"
      "ld1 { v27.s }[2], [x9]\n"
      "ld1 { v28.s }[2], [x27]\n"
      "b 94f\n"
      "93:"  // Height 5: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "ldr s26, [x11, #0x0]\n"
      "ldr s27, [x9, #0x0]\n"
      "ldr s28, [x27, #0x0]\n"
      "94:"  // Height 5: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "sub x11, x11, x19\n"
      "sub x9, x9, x19\n"
      "sub x27, x27, x19\n"
      "b 97f\n"
      "95:"  // Height 5: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "ldr q26, [x11, #0x0]\n"
      "ldr q27, [x9, #0x0]\n"
      "ldr q28, [x27, #0x0]\n"
      "b 97f\n"
      "96:"  // Height 5: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "movi v26.16b, #0x0\n"
      "movi v27.16b, #0x0\n"
      "movi v28.16b, #0x0\n"
      "97:"  // Height 5: setup done
      "mov x16, #0x0\n"
      "98:"  // Height 5: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 99f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "ldr x10, [x20, #0x10]\n"
      "ldr x28, [x20, #0x18]\n"
      "ldr x26, [x20, #0x20]\n"
      "cbnz x16, 100f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "add x10, x10, x19, LSL #2\n"
      "add x28, x28, x19, LSL #2\n"
      "add x26, x26, x19, LSL #2\n"
      "b 100f\n"
      "99:"  // Height 5: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "add x10, x12, x19, LSL #2\n"
      "add x28, x10, x19, LSL #2\n"
      "add x26, x28, x19, LSL #2\n"
      "100:"  // Height 5: input setup done
      "cmp x15, #0x4\n"
      "blt 103f\n"
      "cmp x15, #0x8\n"
      "blt 102f\n"
      "101:"  // Height 5: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v26.4s, v8.4s, v2.s[0]\n"
      "ldr q11, [x7, #0x30]\n"
      "fmla v27.4s, v8.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v8.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v26.4s, v9.4s, v2.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v27.4s, v9.4s, v3.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v28.4s, v9.4s, v4.s[1]\n"
      "cmp x15, #0x8\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "add x7, x7, #0x40\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "fmla v26.4s, v10.4s, v2.s[2]\n"
      "fmla v27.4s, v10.4s, v3.s[2]\n"
      "fmla v28.4s, v10.4s, v4.s[2]\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "fmla v26.4s, v11.4s, v2.s[3]\n"
      "fmla v27.4s, v11.4s, v3.s[3]\n"
      "fmla v28.4s, v11.4s, v4.s[3]\n"
      "bge 101b\n"
      "102:"  // Height 5: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v26.4s, v12.4s, v2.s[0]\n"
      "ldr q15, [x7, #0x30]\n"
      "fmla v27.4s, v12.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v12.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v26.4s, v13.4s, v2.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v27.4s, v13.4s, v3.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v28.4s, v13.4s, v4.s[1]\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v26.4s, v14.4s, v2.s[2]\n"
      "fmla v27.4s, v14.4s, v3.s[2]\n"
      "fmla v28.4s, v14.4s, v4.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "fmla v26.4s, v15.4s, v2.s[3]\n"
      "fmla v27.4s, v15.4s, v3.s[3]\n"
      "fmla v28.4s, v15.4s, v4.s[3]\n"
      "103:"  // Height 5: Multiply loop: Main loop skip
      "cbz x15, 105f\n"
      "104:"  // Height 5: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr s2, [x10], #0x4\n"
      "ldr s3, [x28], #0x4\n"
      "ldr s4, [x26], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "fmla v26.4s, v16.4s, v2.s[0]\n"
      "fmla v27.4s, v16.4s, v3.s[0]\n"
      "fmla v28.4s, v16.4s, v4.s[0]\n"
      "cbnz x15, 104b\n"
      "105:"  // Height 5: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 98b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "prfm pstl1keep, [x11, #0x0]\n"
      "prfm pstl1keep, [x9, #0x0]\n"
      "prfm pstl1keep, [x27, #0x0]\n"
      "tbz %x[flags], #1, 106f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmin v26.4s, v26.4s, v16.4s\n"
      "fmin v27.4s, v27.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "fmax v26.4s, v26.4s, v17.4s\n"
      "fmax v27.4s, v27.4s, v17.4s\n"
      "fmin v28.4s, v28.4s, v16.4s\n"
      "fmax v28.4s, v28.4s, v17.4s\n"
      "106:"  // Height 5: No activation
      "cmp x6, #0x4\n"
      "bge 109f\n"
      "tbz x6, #1, 107f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "str d26, [x11], #0x8\n"
      "str d27, [x9], #0x8\n"
      "str d28, [x27], #0x8\n"
      "tbz x6, #0, 108f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "st1 { v26.s }[2], [x11]\n"
      "st1 { v27.s }[2], [x9]\n"
      "st1 { v28.s }[2], [x27]\n"
      "b 108f\n"
      "107:"  // Height 5: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "str s26, [x11, #0x0]\n"
      "str s27, [x9, #0x0]\n"
      "str s28, [x27, #0x0]\n"
      "108:"  // Height 5: Partial direct writeback: Done
      "b 110f\n"
      "109:"  // Height 5: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "str q26, [x11, #0x0]\n"
      "str q27, [x9, #0x0]\n"
      "str q28, [x27, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "add x11, x11, #0x10\n"
      "add x9, x9, #0x10\n"
      "add x27, x27, #0x10\n"
      "110:"  // Height 5: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 91b\n"
      "b 178f\n"
      "111:"  // Height 6
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 112f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "ldr x11, [%x[output_ptr], #0x10]\n"
      "add x13, x13, x19, LSL #2\n"
      "ldr x9, [%x[output_ptr], #0x18]\n"
      "ldr x27, [%x[output_ptr], #0x20]\n"
      "add x11, x11, x19, LSL #2\n"
      "ldr x25, [%x[output_ptr], #0x28]\n"
      "add x9, x9, x19, LSL #2\n"
      "add x27, x27, x19, LSL #2\n"
      "add x25, x25, x19, LSL #2\n"
      "b 113f\n"
      "112:"  // Height 6: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "add x11, x13, x19, LSL #2\n"
      "add x9, x11, x19, LSL #2\n"
      "add x27, x9, x19, LSL #2\n"
      "add x25, x27, x19, LSL #2\n"
      "113:"  // Height 6: Column loop
      "cbz x8, 114f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "mov v26.16b, v24.16b\n"
      "mov v27.16b, v24.16b\n"
      "mov v28.16b, v24.16b\n"
      "mov v29.16b, v24.16b\n"
      "b 119f\n"
      "114:"  // Height 6: no bias
      "tbz %x[flags], #0, 118f\n"
      "cmp x6, #0x4\n"
      "bge 117f\n"
      "tbz x6, #1, 115f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "ldr d26, [x11], #0x8\n"
      "ldr d27, [x9], #0x8\n"
      "ldr d28, [x27], #0x8\n"
      "ldr d29, [x25], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 116f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "ld1 { v26.s }[2], [x11]\n"
      "ld1 { v27.s }[2], [x9]\n"
      "ld1 { v28.s }[2], [x27]\n"
      "ld1 { v29.s }[2], [x25]\n"
      "b 116f\n"
      "115:"  // Height 6: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "ldr s26, [x11, #0x0]\n"
      "ldr s27, [x9, #0x0]\n"
      "ldr s28, [x27, #0x0]\n"
      "ldr s29, [x25, #0x0]\n"
      "116:"  // Height 6: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "sub x11, x11, x19\n"
      "sub x9, x9, x19\n"
      "sub x27, x27, x19\n"
      "sub x25, x25, x19\n"
      "b 119f\n"
      "117:"  // Height 6: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "ldr q26, [x11, #0x0]\n"
      "ldr q27, [x9, #0x0]\n"
      "ldr q28, [x27, #0x0]\n"
      "ldr q29, [x25, #0x0]\n"
      "b 119f\n"
      "118:"  // Height 6: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "movi v26.16b, #0x0\n"
      "movi v27.16b, #0x0\n"
      "movi v28.16b, #0x0\n"
      "movi v29.16b, #0x0\n"
      "119:"  // Height 6: setup done
      "mov x16, #0x0\n"
      "120:"  // Height 6: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 121f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "ldr x10, [x20, #0x10]\n"
      "ldr x28, [x20, #0x18]\n"
      "ldr x26, [x20, #0x20]\n"
      "ldr x24, [x20, #0x28]\n"
      "cbnz x16, 122f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "add x10, x10, x19, LSL #2\n"
      "add x28, x28, x19, LSL #2\n"
      "add x26, x26, x19, LSL #2\n"
      "add x24, x24, x19, LSL #2\n"
      "b 122f\n"
      "121:"  // Height 6: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "add x10, x12, x19, LSL #2\n"
      "add x28, x10, x19, LSL #2\n"
      "add x26, x28, x19, LSL #2\n"
      "add x24, x26, x19, LSL #2\n"
      "122:"  // Height 6: input setup done
      "cmp x15, #0x4\n"
      "blt 125f\n"
      "cmp x15, #0x8\n"
      "blt 124f\n"
      "123:"  // Height 6: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q5, [x24, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v26.4s, v8.4s, v2.s[0]\n"
      "ldr q11, [x7, #0x30]\n"
      "fmla v27.4s, v8.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v8.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v29.4s, v8.4s, v5.s[0]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v26.4s, v9.4s, v2.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x24, x24, #0x10\n"
      "fmla v27.4s, v9.4s, v3.s[1]\n"
      "prfm pldl1keep, [x24, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v28.4s, v9.4s, v4.s[1]\n"
      "cmp x15, #0x8\n"
      "fmla v29.4s, v9.4s, v5.s[1]\n"
      "add x7, x7, #0x40\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "fmla v26.4s, v10.4s, v2.s[2]\n"
      "fmla v27.4s, v10.4s, v3.s[2]\n"
      "fmla v28.4s, v10.4s, v4.s[2]\n"
      "fmla v29.4s, v10.4s, v5.s[2]\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "fmla v26.4s, v11.4s, v2.s[3]\n"
      "fmla v27.4s, v11.4s, v3.s[3]\n"
      "fmla v28.4s, v11.4s, v4.s[3]\n"
      "fmla v29.4s, v11.4s, v5.s[3]\n"
      "bge 123b\n"
      "124:"  // Height 6: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q5, [x24, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v26.4s, v12.4s, v2.s[0]\n"
      "ldr q15, [x7, #0x30]\n"
      "fmla v27.4s, v12.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v12.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v29.4s, v12.4s, v5.s[0]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v26.4s, v13.4s, v2.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x24, x24, #0x10\n"
      "fmla v27.4s, v13.4s, v3.s[1]\n"
      "prfm pldl1keep, [x24, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v28.4s, v13.4s, v4.s[1]\n"
      "fmla v29.4s, v13.4s, v5.s[1]\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v26.4s, v14.4s, v2.s[2]\n"
      "fmla v27.4s, v14.4s, v3.s[2]\n"
      "fmla v28.4s, v14.4s, v4.s[2]\n"
      "fmla v29.4s, v14.4s, v5.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "fmla v26.4s, v15.4s, v2.s[3]\n"
      "fmla v27.4s, v15.4s, v3.s[3]\n"
      "fmla v28.4s, v15.4s, v4.s[3]\n"
      "fmla v29.4s, v15.4s, v5.s[3]\n"
      "125:"  // Height 6: Multiply loop: Main loop skip
      "cbz x15, 127f\n"
      "126:"  // Height 6: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr s2, [x10], #0x4\n"
      "ldr s3, [x28], #0x4\n"
      "ldr s4, [x26], #0x4\n"
      "ldr s5, [x24], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "fmla v26.4s, v16.4s, v2.s[0]\n"
      "fmla v27.4s, v16.4s, v3.s[0]\n"
      "fmla v28.4s, v16.4s, v4.s[0]\n"
      "fmla v29.4s, v16.4s, v5.s[0]\n"
      "cbnz x15, 126b\n"
      "127:"  // Height 6: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 120b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "prfm pstl1keep, [x11, #0x0]\n"
      "prfm pstl1keep, [x9, #0x0]\n"
      "prfm pstl1keep, [x27, #0x0]\n"
      "prfm pstl1keep, [x25, #0x0]\n"
      "tbz %x[flags], #1, 128f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmin v26.4s, v26.4s, v16.4s\n"
      "fmin v27.4s, v27.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "fmax v26.4s, v26.4s, v17.4s\n"
      "fmax v27.4s, v27.4s, v17.4s\n"
      "fmin v28.4s, v28.4s, v16.4s\n"
      "fmin v29.4s, v29.4s, v16.4s\n"
      "fmax v28.4s, v28.4s, v17.4s\n"
      "fmax v29.4s, v29.4s, v17.4s\n"
      "128:"  // Height 6: No activation
      "cmp x6, #0x4\n"
      "bge 131f\n"
      "tbz x6, #1, 129f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "str d26, [x11], #0x8\n"
      "str d27, [x9], #0x8\n"
      "str d28, [x27], #0x8\n"
      "str d29, [x25], #0x8\n"
      "tbz x6, #0, 130f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "st1 { v26.s }[2], [x11]\n"
      "st1 { v27.s }[2], [x9]\n"
      "st1 { v28.s }[2], [x27]\n"
      "st1 { v29.s }[2], [x25]\n"
      "b 130f\n"
      "129:"  // Height 6: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "str s26, [x11, #0x0]\n"
      "str s27, [x9, #0x0]\n"
      "str s28, [x27, #0x0]\n"
      "str s29, [x25, #0x0]\n"
      "130:"  // Height 6: Partial direct writeback: Done
      "b 132f\n"
      "131:"  // Height 6: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "str q26, [x11, #0x0]\n"
      "str q27, [x9, #0x0]\n"
      "str q28, [x27, #0x0]\n"
      "str q29, [x25, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "add x11, x11, #0x10\n"
      "add x9, x9, #0x10\n"
      "add x27, x27, #0x10\n"
      "add x25, x25, #0x10\n"
      "132:"  // Height 6: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 113b\n"
      "b 178f\n"
      "133:"  // Height 7
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 134f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "ldr x11, [%x[output_ptr], #0x10]\n"
      "add x13, x13, x19, LSL #2\n"
      "ldr x9, [%x[output_ptr], #0x18]\n"
      "ldr x27, [%x[output_ptr], #0x20]\n"
      "add x11, x11, x19, LSL #2\n"
      "ldr x25, [%x[output_ptr], #0x28]\n"
      "add x9, x9, x19, LSL #2\n"
      "ldr x23, [%x[output_ptr], #0x30]\n"
      "add x27, x27, x19, LSL #2\n"
      "add x25, x25, x19, LSL #2\n"
      "add x23, x23, x19, LSL #2\n"
      "b 135f\n"
      "134:"  // Height 7: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "add x11, x13, x19, LSL #2\n"
      "add x9, x11, x19, LSL #2\n"
      "add x27, x9, x19, LSL #2\n"
      "add x25, x27, x19, LSL #2\n"
      "add x23, x25, x19, LSL #2\n"
      "135:"  // Height 7: Column loop
      "cbz x8, 136f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "mov v26.16b, v24.16b\n"
      "mov v27.16b, v24.16b\n"
      "mov v28.16b, v24.16b\n"
      "mov v29.16b, v24.16b\n"
      "mov v30.16b, v24.16b\n"
      "b 141f\n"
      "136:"  // Height 7: no bias
      "tbz %x[flags], #0, 140f\n"
      "cmp x6, #0x4\n"
      "bge 139f\n"
      "tbz x6, #1, 137f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "ldr d26, [x11], #0x8\n"
      "ldr d27, [x9], #0x8\n"
      "ldr d28, [x27], #0x8\n"
      "ldr d29, [x25], #0x8\n"
      "ldr d30, [x23], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 138f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "ld1 { v26.s }[2], [x11]\n"
      "ld1 { v27.s }[2], [x9]\n"
      "ld1 { v28.s }[2], [x27]\n"
      "ld1 { v29.s }[2], [x25]\n"
      "ld1 { v30.s }[2], [x23]\n"
      "b 138f\n"
      "137:"  // Height 7: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "ldr s26, [x11, #0x0]\n"
      "ldr s27, [x9, #0x0]\n"
      "ldr s28, [x27, #0x0]\n"
      "ldr s29, [x25, #0x0]\n"
      "ldr s30, [x23, #0x0]\n"
      "138:"  // Height 7: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "sub x11, x11, x19\n"
      "sub x9, x9, x19\n"
      "sub x27, x27, x19\n"
      "sub x25, x25, x19\n"
      "sub x23, x23, x19\n"
      "b 141f\n"
      "139:"  // Height 7: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "ldr q26, [x11, #0x0]\n"
      "ldr q27, [x9, #0x0]\n"
      "ldr q28, [x27, #0x0]\n"
      "ldr q29, [x25, #0x0]\n"
      "ldr q30, [x23, #0x0]\n"
      "b 141f\n"
      "140:"  // Height 7: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "movi v26.16b, #0x0\n"
      "movi v27.16b, #0x0\n"
      "movi v28.16b, #0x0\n"
      "movi v29.16b, #0x0\n"
      "movi v30.16b, #0x0\n"
      "141:"  // Height 7: setup done
      "mov x16, #0x0\n"
      "142:"  // Height 7: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 143f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "ldr x10, [x20, #0x10]\n"
      "ldr x28, [x20, #0x18]\n"
      "ldr x26, [x20, #0x20]\n"
      "ldr x24, [x20, #0x28]\n"
      "ldr x22, [x20, #0x30]\n"
      "cbnz x16, 144f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "add x10, x10, x19, LSL #2\n"
      "add x28, x28, x19, LSL #2\n"
      "add x26, x26, x19, LSL #2\n"
      "add x24, x24, x19, LSL #2\n"
      "add x22, x22, x19, LSL #2\n"
      "b 144f\n"
      "143:"  // Height 7: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "add x10, x12, x19, LSL #2\n"
      "add x28, x10, x19, LSL #2\n"
      "add x26, x28, x19, LSL #2\n"
      "add x24, x26, x19, LSL #2\n"
      "add x22, x24, x19, LSL #2\n"
      "144:"  // Height 7: input setup done
      "cmp x15, #0x4\n"
      "blt 147f\n"
      "cmp x15, #0x8\n"
      "blt 146f\n"
      "145:"  // Height 7: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q5, [x24, #0x0]\n"
      "ldr q6, [x22, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v26.4s, v8.4s, v2.s[0]\n"
      "ldr q11, [x7, #0x30]\n"
      "fmla v27.4s, v8.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v8.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v29.4s, v8.4s, v5.s[0]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v30.4s, v8.4s, v6.s[0]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x24, x24, #0x10\n"
      "fmla v26.4s, v9.4s, v2.s[1]\n"
      "prfm pldl1keep, [x24, #0x80]\n"
      "add x22, x22, #0x10\n"
      "fmla v27.4s, v9.4s, v3.s[1]\n"
      "prfm pldl1keep, [x22, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v28.4s, v9.4s, v4.s[1]\n"
      "cmp x15, #0x8\n"
      "fmla v29.4s, v9.4s, v5.s[1]\n"
      "add x7, x7, #0x40\n"
      "fmla v30.4s, v9.4s, v6.s[1]\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "fmla v26.4s, v10.4s, v2.s[2]\n"
      "fmla v27.4s, v10.4s, v3.s[2]\n"
      "fmla v28.4s, v10.4s, v4.s[2]\n"
      "fmla v29.4s, v10.4s, v5.s[2]\n"
      "fmla v30.4s, v10.4s, v6.s[2]\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "fmla v26.4s, v11.4s, v2.s[3]\n"
      "fmla v27.4s, v11.4s, v3.s[3]\n"
      "fmla v28.4s, v11.4s, v4.s[3]\n"
      "fmla v29.4s, v11.4s, v5.s[3]\n"
      "fmla v30.4s, v11.4s, v6.s[3]\n"
      "bge 145b\n"
      "146:"  // Height 7: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q5, [x24, #0x0]\n"
      "ldr q6, [x22, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v26.4s, v12.4s, v2.s[0]\n"
      "ldr q15, [x7, #0x30]\n"
      "fmla v27.4s, v12.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v12.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v29.4s, v12.4s, v5.s[0]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v30.4s, v12.4s, v6.s[0]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x24, x24, #0x10\n"
      "fmla v26.4s, v13.4s, v2.s[1]\n"
      "prfm pldl1keep, [x24, #0x80]\n"
      "add x22, x22, #0x10\n"
      "fmla v27.4s, v13.4s, v3.s[1]\n"
      "prfm pldl1keep, [x22, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v28.4s, v13.4s, v4.s[1]\n"
      "fmla v29.4s, v13.4s, v5.s[1]\n"
      "fmla v30.4s, v13.4s, v6.s[1]\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v26.4s, v14.4s, v2.s[2]\n"
      "fmla v27.4s, v14.4s, v3.s[2]\n"
      "fmla v28.4s, v14.4s, v4.s[2]\n"
      "fmla v29.4s, v14.4s, v5.s[2]\n"
      "fmla v30.4s, v14.4s, v6.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "fmla v26.4s, v15.4s, v2.s[3]\n"
      "fmla v27.4s, v15.4s, v3.s[3]\n"
      "fmla v28.4s, v15.4s, v4.s[3]\n"
      "fmla v29.4s, v15.4s, v5.s[3]\n"
      "fmla v30.4s, v15.4s, v6.s[3]\n"
      "147:"  // Height 7: Multiply loop: Main loop skip
      "cbz x15, 149f\n"
      "148:"  // Height 7: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr s2, [x10], #0x4\n"
      "ldr s3, [x28], #0x4\n"
      "ldr s4, [x26], #0x4\n"
      "ldr s5, [x24], #0x4\n"
      "ldr s6, [x22], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "fmla v26.4s, v16.4s, v2.s[0]\n"
      "fmla v27.4s, v16.4s, v3.s[0]\n"
      "fmla v28.4s, v16.4s, v4.s[0]\n"
      "fmla v29.4s, v16.4s, v5.s[0]\n"
      "fmla v30.4s, v16.4s, v6.s[0]\n"
      "cbnz x15, 148b\n"
      "149:"  // Height 7: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 142b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "prfm pstl1keep, [x11, #0x0]\n"
      "prfm pstl1keep, [x9, #0x0]\n"
      "prfm pstl1keep, [x27, #0x0]\n"
      "prfm pstl1keep, [x25, #0x0]\n"
      "prfm pstl1keep, [x23, #0x0]\n"
      "tbz %x[flags], #1, 150f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmin v26.4s, v26.4s, v16.4s\n"
      "fmin v27.4s, v27.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "fmax v26.4s, v26.4s, v17.4s\n"
      "fmax v27.4s, v27.4s, v17.4s\n"
      "fmin v28.4s, v28.4s, v16.4s\n"
      "fmin v29.4s, v29.4s, v16.4s\n"
      "fmin v30.4s, v30.4s, v16.4s\n"
      "fmax v28.4s, v28.4s, v17.4s\n"
      "fmax v29.4s, v29.4s, v17.4s\n"
      "fmax v30.4s, v30.4s, v17.4s\n"
      "150:"  // Height 7: No activation
      "cmp x6, #0x4\n"
      "bge 153f\n"
      "tbz x6, #1, 151f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "str d26, [x11], #0x8\n"
      "str d27, [x9], #0x8\n"
      "str d28, [x27], #0x8\n"
      "str d29, [x25], #0x8\n"
      "str d30, [x23], #0x8\n"
      "tbz x6, #0, 152f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "st1 { v26.s }[2], [x11]\n"
      "st1 { v27.s }[2], [x9]\n"
      "st1 { v28.s }[2], [x27]\n"
      "st1 { v29.s }[2], [x25]\n"
      "st1 { v30.s }[2], [x23]\n"
      "b 152f\n"
      "151:"  // Height 7: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "str s26, [x11, #0x0]\n"
      "str s27, [x9, #0x0]\n"
      "str s28, [x27, #0x0]\n"
      "str s29, [x25, #0x0]\n"
      "str s30, [x23, #0x0]\n"
      "152:"  // Height 7: Partial direct writeback: Done
      "b 154f\n"
      "153:"  // Height 7: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "str q26, [x11, #0x0]\n"
      "str q27, [x9, #0x0]\n"
      "str q28, [x27, #0x0]\n"
      "str q29, [x25, #0x0]\n"
      "str q30, [x23, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "add x11, x11, #0x10\n"
      "add x9, x9, #0x10\n"
      "add x27, x27, #0x10\n"
      "add x25, x25, #0x10\n"
      "add x23, x23, #0x10\n"
      "154:"  // Height 7: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 135b\n"
      "b 178f\n"
      "155:"  // Height 8
      "ldr x6, [%x[args_ptr], %[offsetof_N]]\n"
      "mov x8, %x[bias]\n"
      "ldr x7, [%x[args_ptr], %[offsetof_B_ptr]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_output_offset]]\n"
      "tbz %x[flags], #2, 156f\n"
      "ldr x17, [%x[output_ptr], #0x0]\n"
      "add x17, x17, x19, LSL #2\n"
      "ldr x13, [%x[output_ptr], #0x8]\n"
      "ldr x11, [%x[output_ptr], #0x10]\n"
      "add x13, x13, x19, LSL #2\n"
      "ldr x9, [%x[output_ptr], #0x18]\n"
      "ldr x27, [%x[output_ptr], #0x20]\n"
      "add x11, x11, x19, LSL #2\n"
      "ldr x25, [%x[output_ptr], #0x28]\n"
      "add x9, x9, x19, LSL #2\n"
      "ldr x23, [%x[output_ptr], #0x30]\n"
      "ldr x21, [%x[output_ptr], #0x38]\n"
      "add x27, x27, x19, LSL #2\n"
      "add x25, x25, x19, LSL #2\n"
      "add %x[output_ptr], %x[output_ptr], #0x40\n"
      "add x23, x23, x19, LSL #2\n"
      "add x21, x21, x19, LSL #2\n"
      "b 157f\n"
      "156:"  // Height 8: setup direct output
      "mov x17, %x[output_ptr]\n"
      "add x13, x17, x19, LSL #2\n"
      "add x11, x13, x19, LSL #2\n"
      "add x9, x11, x19, LSL #2\n"
      "add x27, x9, x19, LSL #2\n"
      "add x25, x27, x19, LSL #2\n"
      "add x23, x25, x19, LSL #2\n"
      "add x21, x23, x19, LSL #2\n"
      "add %x[output_ptr], x21, x19, LSL #2\n"
      "157:"  // Height 8: Column loop
      "cbz x8, 158f\n"
      "ldr q24, [x8, #0x0]\n"
      "mov v25.16b, v24.16b\n"
      "add x8, x8, #0x10\n"
      "mov v26.16b, v24.16b\n"
      "mov v27.16b, v24.16b\n"
      "mov v28.16b, v24.16b\n"
      "mov v29.16b, v24.16b\n"
      "mov v30.16b, v24.16b\n"
      "mov v31.16b, v24.16b\n"
      "b 163f\n"
      "158:"  // Height 8: no bias
      "tbz %x[flags], #0, 162f\n"
      "cmp x6, #0x4\n"
      "bge 161f\n"
      "tbz x6, #1, 159f\n"
      "ldr d24, [x17], #0x8\n"
      "ldr d25, [x13], #0x8\n"
      "ldr d26, [x11], #0x8\n"
      "ldr d27, [x9], #0x8\n"
      "ldr d28, [x27], #0x8\n"
      "ldr d29, [x25], #0x8\n"
      "ldr d30, [x23], #0x8\n"
      "ldr d31, [x21], #0x8\n"
      "mov x19, #0x8\n"
      "tbz x6, #0, 160f\n"
      "ld1 { v24.s }[2], [x17]\n"
      "ld1 { v25.s }[2], [x13]\n"
      "ld1 { v26.s }[2], [x11]\n"
      "ld1 { v27.s }[2], [x9]\n"
      "ld1 { v28.s }[2], [x27]\n"
      "ld1 { v29.s }[2], [x25]\n"
      "ld1 { v30.s }[2], [x23]\n"
      "ld1 { v31.s }[2], [x21]\n"
      "b 160f\n"
      "159:"  // Height 8: Partial accumulate: partial_1_0
      "mov x19, #0x0\n"
      "ldr s24, [x17, #0x0]\n"
      "ldr s25, [x13, #0x0]\n"
      "ldr s26, [x11, #0x0]\n"
      "ldr s27, [x9, #0x0]\n"
      "ldr s28, [x27, #0x0]\n"
      "ldr s29, [x25, #0x0]\n"
      "ldr s30, [x23, #0x0]\n"
      "ldr s31, [x21, #0x0]\n"
      "160:"  // Height 8: Partial accumulate: Done
      "sub x17, x17, x19\n"
      "sub x13, x13, x19\n"
      "sub x11, x11, x19\n"
      "sub x9, x9, x19\n"
      "sub x27, x27, x19\n"
      "sub x25, x25, x19\n"
      "sub x23, x23, x19\n"
      "sub x21, x21, x19\n"
      "b 163f\n"
      "161:"  // Height 8: full accumulate
      "ldr q24, [x17, #0x0]\n"
      "ldr q25, [x13, #0x0]\n"
      "ldr q26, [x11, #0x0]\n"
      "ldr q27, [x9, #0x0]\n"
      "ldr q28, [x27, #0x0]\n"
      "ldr q29, [x25, #0x0]\n"
      "ldr q30, [x23, #0x0]\n"
      "ldr q31, [x21, #0x0]\n"
      "b 163f\n"
      "162:"  // Height 8: no accumulate
      "movi v24.16b, #0x0\n"
      "movi v25.16b, #0x0\n"
      "movi v26.16b, #0x0\n"
      "movi v27.16b, #0x0\n"
      "movi v28.16b, #0x0\n"
      "movi v29.16b, #0x0\n"
      "movi v30.16b, #0x0\n"
      "movi v31.16b, #0x0\n"
      "163:"  // Height 8: setup done
      "mov x16, #0x0\n"
      "164:"  // Height 8: String loop
      "ldr x20, [%x[args_ptr], %[offsetof_string_lengths]]\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "ldr w15, [x20, x16, LSL #0x2]\n"
      "tbz %x[flags], #3, 165f\n"
      "ldr x20, [%x[input_ptr], x16, LSL #0x3]\n"
      "add x20, x20, x19, LSL #3\n"
      "ldr x14, [x20, #0x0]\n"
      "ldr x12, [x20, #0x8]\n"
      "ldr x10, [x20, #0x10]\n"
      "ldr x28, [x20, #0x18]\n"
      "ldr x26, [x20, #0x20]\n"
      "ldr x24, [x20, #0x28]\n"
      "ldr x22, [x20, #0x30]\n"
      "ldr x20, [x20, #0x38]\n"
      "cbnz x16, 166f\n"
      "ldr x19, [%x[args_ptr], %[offsetof_input_initial_col]]\n"
      "add x14, x14, x19, LSL #2\n"
      "add x12, x12, x19, LSL #2\n"
      "add x10, x10, x19, LSL #2\n"
      "add x28, x28, x19, LSL #2\n"
      "add x26, x26, x19, LSL #2\n"
      "add x24, x24, x19, LSL #2\n"
      "add x22, x22, x19, LSL #2\n"
      "add x20, x20, x19, LSL #2\n"
      "b 166f\n"
      "165:"  // Height 8: setup direct input
      "mov x14, %x[input_ptr]\n"
      "add x12, x14, x19, LSL #2\n"
      "add x10, x12, x19, LSL #2\n"
      "add x28, x10, x19, LSL #2\n"
      "add x26, x28, x19, LSL #2\n"
      "add x24, x26, x19, LSL #2\n"
      "add x22, x24, x19, LSL #2\n"
      "add x20, x22, x19, LSL #2\n"
      "166:"  // Height 8: input setup done
      "cmp x15, #0x4\n"
      "blt 169f\n"
      "cmp x15, #0x8\n"
      "blt 168f\n"
      "167:"  // Height 8: Multiply loop: Main loop head
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q5, [x24, #0x0]\n"
      "ldr q6, [x22, #0x0]\n"
      "ldr q7, [x20, #0x0]\n"
      "ldr q8, [x7, #0x0]\n"
      "fmla v24.4s, v8.4s, v0.s[0]\n"
      "ldr q9, [x7, #0x10]\n"
      "fmla v25.4s, v8.4s, v1.s[0]\n"
      "ldr q10, [x7, #0x20]\n"
      "fmla v26.4s, v8.4s, v2.s[0]\n"
      "ldr q11, [x7, #0x30]\n"
      "fmla v27.4s, v8.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v8.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v29.4s, v8.4s, v5.s[0]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v30.4s, v8.4s, v6.s[0]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v31.4s, v8.4s, v7.s[0]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v24.4s, v9.4s, v0.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x24, x24, #0x10\n"
      "fmla v25.4s, v9.4s, v1.s[1]\n"
      "prfm pldl1keep, [x24, #0x80]\n"
      "add x22, x22, #0x10\n"
      "fmla v26.4s, v9.4s, v2.s[1]\n"
      "prfm pldl1keep, [x22, #0x80]\n"
      "add x20, x20, #0x10\n"
      "fmla v27.4s, v9.4s, v3.s[1]\n"
      "prfm pldl1keep, [x20, #0x80]\n"
      "sub x15, x15, #0x4\n"
      "fmla v28.4s, v9.4s, v4.s[1]\n"
      "cmp x15, #0x8\n"
      "fmla v29.4s, v9.4s, v5.s[1]\n"
      "add x7, x7, #0x40\n"
      "fmla v30.4s, v9.4s, v6.s[1]\n"
      "fmla v31.4s, v9.4s, v7.s[1]\n"
      "fmla v24.4s, v10.4s, v0.s[2]\n"
      "fmla v25.4s, v10.4s, v1.s[2]\n"
      "fmla v26.4s, v10.4s, v2.s[2]\n"
      "fmla v27.4s, v10.4s, v3.s[2]\n"
      "fmla v28.4s, v10.4s, v4.s[2]\n"
      "fmla v29.4s, v10.4s, v5.s[2]\n"
      "fmla v30.4s, v10.4s, v6.s[2]\n"
      "fmla v31.4s, v10.4s, v7.s[2]\n"
      "fmla v24.4s, v11.4s, v0.s[3]\n"
      "fmla v25.4s, v11.4s, v1.s[3]\n"
      "fmla v26.4s, v11.4s, v2.s[3]\n"
      "fmla v27.4s, v11.4s, v3.s[3]\n"
      "fmla v28.4s, v11.4s, v4.s[3]\n"
      "fmla v29.4s, v11.4s, v5.s[3]\n"
      "fmla v30.4s, v11.4s, v6.s[3]\n"
      "fmla v31.4s, v11.4s, v7.s[3]\n"
      "bge 167b\n"
      "168:"  // Height 8: Multiply loop: Single iteration only
      "sub x15, x15, #0x4\n"
      "ldr q0, [x14, #0x0]\n"
      "ldr q1, [x12, #0x0]\n"
      "ldr q2, [x10, #0x0]\n"
      "ldr q3, [x28, #0x0]\n"
      "ldr q4, [x26, #0x0]\n"
      "ldr q5, [x24, #0x0]\n"
      "ldr q6, [x22, #0x0]\n"
      "ldr q7, [x20, #0x0]\n"
      "ldr q12, [x7, #0x0]\n"
      "fmla v24.4s, v12.4s, v0.s[0]\n"
      "ldr q13, [x7, #0x10]\n"
      "fmla v25.4s, v12.4s, v1.s[0]\n"
      "ldr q14, [x7, #0x20]\n"
      "fmla v26.4s, v12.4s, v2.s[0]\n"
      "ldr q15, [x7, #0x30]\n"
      "fmla v27.4s, v12.4s, v3.s[0]\n"
      "add x14, x14, #0x10\n"
      "prfm pldl1keep, [x14, #0x80]\n"
      "fmla v28.4s, v12.4s, v4.s[0]\n"
      "add x12, x12, #0x10\n"
      "fmla v29.4s, v12.4s, v5.s[0]\n"
      "prfm pldl1keep, [x12, #0x80]\n"
      "add x10, x10, #0x10\n"
      "fmla v30.4s, v12.4s, v6.s[0]\n"
      "prfm pldl1keep, [x10, #0x80]\n"
      "add x28, x28, #0x10\n"
      "fmla v31.4s, v12.4s, v7.s[0]\n"
      "prfm pldl1keep, [x28, #0x80]\n"
      "add x26, x26, #0x10\n"
      "fmla v24.4s, v13.4s, v0.s[1]\n"
      "prfm pldl1keep, [x26, #0x80]\n"
      "add x24, x24, #0x10\n"
      "fmla v25.4s, v13.4s, v1.s[1]\n"
      "prfm pldl1keep, [x24, #0x80]\n"
      "add x22, x22, #0x10\n"
      "fmla v26.4s, v13.4s, v2.s[1]\n"
      "prfm pldl1keep, [x22, #0x80]\n"
      "add x20, x20, #0x10\n"
      "fmla v27.4s, v13.4s, v3.s[1]\n"
      "prfm pldl1keep, [x20, #0x80]\n"
      "add x7, x7, #0x40\n"
      "fmla v28.4s, v13.4s, v4.s[1]\n"
      "fmla v29.4s, v13.4s, v5.s[1]\n"
      "fmla v30.4s, v13.4s, v6.s[1]\n"
      "fmla v31.4s, v13.4s, v7.s[1]\n"
      "fmla v24.4s, v14.4s, v0.s[2]\n"
      "fmla v25.4s, v14.4s, v1.s[2]\n"
      "fmla v26.4s, v14.4s, v2.s[2]\n"
      "fmla v27.4s, v14.4s, v3.s[2]\n"
      "fmla v28.4s, v14.4s, v4.s[2]\n"
      "fmla v29.4s, v14.4s, v5.s[2]\n"
      "fmla v30.4s, v14.4s, v6.s[2]\n"
      "fmla v31.4s, v14.4s, v7.s[2]\n"
      "fmla v24.4s, v15.4s, v0.s[3]\n"
      "fmla v25.4s, v15.4s, v1.s[3]\n"
      "fmla v26.4s, v15.4s, v2.s[3]\n"
      "fmla v27.4s, v15.4s, v3.s[3]\n"
      "fmla v28.4s, v15.4s, v4.s[3]\n"
      "fmla v29.4s, v15.4s, v5.s[3]\n"
      "fmla v30.4s, v15.4s, v6.s[3]\n"
      "fmla v31.4s, v15.4s, v7.s[3]\n"
      "169:"  // Height 8: Multiply loop: Main loop skip
      "cbz x15, 171f\n"
      "170:"  // Height 8: Multiply loop: Odd block loop
      "ldr s0, [x14], #0x4\n"
      "ldr s1, [x12], #0x4\n"
      "ldr s2, [x10], #0x4\n"
      "ldr s3, [x28], #0x4\n"
      "ldr s4, [x26], #0x4\n"
      "ldr s5, [x24], #0x4\n"
      "ldr s6, [x22], #0x4\n"
      "ldr s7, [x20], #0x4\n"
      "ldr q16, [x7, #0x0]\n"
      "fmla v24.4s, v16.4s, v0.s[0]\n"
      "sub x15, x15, #0x1\n"
      "fmla v25.4s, v16.4s, v1.s[0]\n"
      "add x7, x7, #0x10\n"
      "fmla v26.4s, v16.4s, v2.s[0]\n"
      "fmla v27.4s, v16.4s, v3.s[0]\n"
      "fmla v28.4s, v16.4s, v4.s[0]\n"
      "fmla v29.4s, v16.4s, v5.s[0]\n"
      "fmla v30.4s, v16.4s, v6.s[0]\n"
      "fmla v31.4s, v16.4s, v7.s[0]\n"
      "cbnz x15, 170b\n"
      "171:"  // Height 8: Multiply loop: No odd multiplies
      "ldr w19, [%x[args_ptr], %[offsetof_num_strings]]\n"
      "add x16, x16, #0x1\n"
      "cmp x16, x19\n"
      "bne 164b\n"
      "prfm pstl1keep, [x17, #0x0]\n"
      "prfm pstl1keep, [x13, #0x0]\n"
      "prfm pstl1keep, [x11, #0x0]\n"
      "prfm pstl1keep, [x9, #0x0]\n"
      "prfm pstl1keep, [x27, #0x0]\n"
      "prfm pstl1keep, [x25, #0x0]\n"
      "prfm pstl1keep, [x23, #0x0]\n"
      "prfm pstl1keep, [x21, #0x0]\n"
      "tbz %x[flags], #1, 172f\n"
      "add x19, %x[args_ptr], %[offset_min]\n"
      "ld1r { v17.4s }, [x19]\n"
      "add x19, %x[args_ptr], %[offset_max]\n"
      "ld1r { v16.4s }, [x19]\n"
      "fmin v24.4s, v24.4s, v16.4s\n"
      "fmin v25.4s, v25.4s, v16.4s\n"
      "fmin v26.4s, v26.4s, v16.4s\n"
      "fmin v27.4s, v27.4s, v16.4s\n"
      "fmax v24.4s, v24.4s, v17.4s\n"
      "fmax v25.4s, v25.4s, v17.4s\n"
      "fmax v26.4s, v26.4s, v17.4s\n"
      "fmax v27.4s, v27.4s, v17.4s\n"
      "fmin v28.4s, v28.4s, v16.4s\n"
      "fmin v29.4s, v29.4s, v16.4s\n"
      "fmin v30.4s, v30.4s, v16.4s\n"
      "fmax v28.4s, v28.4s, v17.4s\n"
      "fmax v29.4s, v29.4s, v17.4s\n"
      "fmax v30.4s, v30.4s, v17.4s\n"
      "fmin v31.4s, v31.4s, v16.4s\n"
      "fmax v31.4s, v31.4s, v17.4s\n"
      "172:"  // Height 8: No activation
      "cmp x6, #0x4\n"
      "bge 175f\n"
      "tbz x6, #1, 173f\n"
      "str d24, [x17], #0x8\n"
      "str d25, [x13], #0x8\n"
      "str d26, [x11], #0x8\n"
      "str d27, [x9], #0x8\n"
      "str d28, [x27], #0x8\n"
      "str d29, [x25], #0x8\n"
      "str d30, [x23], #0x8\n"
      "str d31, [x21], #0x8\n"
      "tbz x6, #0, 174f\n"
      "st1 { v24.s }[2], [x17]\n"
      "st1 { v25.s }[2], [x13]\n"
      "st1 { v26.s }[2], [x11]\n"
      "st1 { v27.s }[2], [x9]\n"
      "st1 { v28.s }[2], [x27]\n"
      "st1 { v29.s }[2], [x25]\n"
      "st1 { v30.s }[2], [x23]\n"
      "st1 { v31.s }[2], [x21]\n"
      "b 174f\n"
      "173:"  // Height 8: Partial direct writeback: partial_1_0
      "str s24, [x17, #0x0]\n"
      "str s25, [x13, #0x0]\n"
      "str s26, [x11, #0x0]\n"
      "str s27, [x9, #0x0]\n"
      "str s28, [x27, #0x0]\n"
      "str s29, [x25, #0x0]\n"
      "str s30, [x23, #0x0]\n"
      "str s31, [x21, #0x0]\n"
      "174:"  // Height 8: Partial direct writeback: Done
      "b 176f\n"
      "175:"  // Height 8: Full writeback
      "str q24, [x17, #0x0]\n"
      "str q25, [x13, #0x0]\n"
      "str q26, [x11, #0x0]\n"
      "str q27, [x9, #0x0]\n"
      "str q28, [x27, #0x0]\n"
      "str q29, [x25, #0x0]\n"
      "str q30, [x23, #0x0]\n"
      "str q31, [x21, #0x0]\n"
      "add x17, x17, #0x10\n"
      "add x13, x13, #0x10\n"
      "add x11, x11, #0x10\n"
      "add x9, x9, #0x10\n"
      "add x27, x27, #0x10\n"
      "add x25, x25, #0x10\n"
      "add x23, x23, #0x10\n"
      "add x21, x21, #0x10\n"
      "176:"  // Height 8: Writeback done
      "subs x6, x6, #0x4\n"
      "bgt 157b\n"
      "subs %x[M], %x[M], #0x8\n"
      "beq 178f\n"
      "ldr x20, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "tbz %x[flags], #3, 177f\n"
      "add x20, x20, #0x8\n"
      "str x20, [%x[args_ptr], %[offsetof_input_offset]]\n"
      "b 1b\n"
      "177:"  // Update direct input
      "mov x19, #0x20\n"
      "madd %x[input_ptr], x19, x20, %x[input_ptr]\n"
      "b 1b\n"
      "178:"  // Exit

      : [M] "+r" (M), [input_ptr] "+r" (input_ptr), [output_ptr] "+r" (output_ptr)
      : [args_ptr] "r" (&ka), [bias] "r" (bias), [flags] "r" (flags), [offset_max] "I" (offsetof(KernelArgs, maxval)), [offset_min] "I" (offsetof(KernelArgs, minval)), [offsetof_B_ptr] "I" (offsetof(KernelArgs, B_ptr)), [offsetof_N] "I" (offsetof(KernelArgs, N)), [offsetof_input_initial_col] "I" (offsetof(KernelArgs, input_initial_col)), [offsetof_input_offset] "I" (offsetof(KernelArgs, input_offset)), [offsetof_num_strings] "I" (offsetof(KernelArgs, num_strings)), [offsetof_output_offset] "I" (offsetof(KernelArgs, output_offset)), [offsetof_string_lengths] "I" (offsetof(KernelArgs, string_lengths))
      : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28"
    );
}

} // namespace arm_gemm
#endif // __aarch64__
